
package com.yimixian.app.cart;

import com.yimixian.app.R;

import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.TextView;

import butterknife.ButterKnife;
import butterknife.InjectView;

public class CartFreebieGoodsItemView extends CartGoodsItemView {

    @InjectView(R.id.freebie_title_text)
    TextView mFreebieTitleText;
    private String mFreebieTitle;

    public CartFreebieGoodsItemView(Context context) {
        super(context);
    }

    public CartFreebieGoodsItemView(Context context, String freebieTitle) {
        super(context);
        mFreebieTitle = freebieTitle;
    }

    public CartFreebieGoodsItemView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CartFreebieGoodsItemView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    protected void init() {
        LayoutInflater.from(getContext()).inflate(R.layout.cart_freebie_goods_item_view, this);
        setLayoutParams(new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT));
        if (!TextUtils.isEmpty(mFreebieTitle)) {
            mFreebieTitleText.setText(mFreebieTitle);
        }
        ButterKnife.inject(this);

    }
}
